package com.k12.admim.rpc;
import com.k12.admim.model.dto.UserDTO;
import com.k12.admim.model.entity.sys.*;
import com.k12.admim.model.vo.*;
import com.k12.admim.model.vo.sys.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;

@FeignClient(name = "user-service")
public interface UserFeignClient {

    @GetMapping("user/listPermission")
    List<String> getPermissionList(@RequestParam("userId") String userId);

    @GetMapping("user/listRole")
    List<String> getRoleList(@RequestParam("userId") String userId);

    @GetMapping("user/getUserInfo")
    UserDTO getUserInfo();

    @PostMapping("user/createTenantAccount")
    Integer createTenantAccount(@RequestBody TenantVo tenantVo);


    @PostMapping("user/login")
    UserDTO userLogin(@RequestParam("username") String username,@RequestParam("password") String password);

    @PostMapping("user/createPerm")
    Integer createPerm(@RequestBody MenuVo menuVo);

    /**
     * 获取用户菜单信息
     *
     * @param userId 用户id
     * @param tenantId 租户id
     * @return List<MenuVo>
     */
    @PostMapping("user/listMenuInfo")
    List<MenuVo> listMenuInfo(@RequestParam("tenantId") String tenantId,@RequestParam("userId") String userId);

    @PostMapping("user/checkRegister")
    String checkRegister(RegUserVo regUserVo);

    @PostMapping("user/addUser")
    Long addUser(RegUserVo regUserVo);

    @PostMapping("user/addSysUserPost")
    void addPost(List<SysUserPostVo> list);

    @PostMapping("user/addUserRole")
    void addUserRole(List<SysUserRoleVo> list);

    @PostMapping("user/getAllDept")
    List<SysDeptVo> getAllDept(SysUserVo sysUserVo);

    @PostMapping("user/checkRole")
    String checkRole(SysRoleVo sysRoleVo);

    @PostMapping("user/insertRole")
    void addRole(SysRoleVo sysRoleVo);

    @PostMapping("user/addMenuRole")
    void addMenuRole(List<SysRoleMenuVo> list);

    @GetMapping("user/selectUserDept")
    List<SysUser> selectUserDept(@RequestParam("tenantId")String tenantId,@RequestParam("userId") Long userId);


    @GetMapping("user/getAllRoles")
    List<SysRole> getAllRoles(String tenantId);

    @GetMapping("user/getRoleIds")
    List<Long> getRoleIds(@RequestParam("userId")Long userId,@RequestParam("tenantId") String tenantId);

    @GetMapping("user/getPostIds")
    List<Long> getAllPostIds(@RequestParam("tenantId")String tenantId,@RequestParam("userId") Long userId);

    @GetMapping("user/getPostByTenantId")
    List<SysPost> getPostByTenantId(String tenantId);


    @GetMapping("user/selectUserById")
    SysUserVo selectUserById(@RequestParam("tenantId")String tenantId,@RequestParam("userId") Long userId);

    @PostMapping("user/updateUser")
    void update(RegUserVo regUserVo);

    @PostMapping("user/deleteUserPostByTenantId")
    void deletePost(@RequestParam("userId")Long userId,@RequestParam("tenantId")String tenantId);

    @PostMapping("user/deleteUserRoleByTenantId")
    void deleteUserRole(@RequestParam("userId")Long userId,@RequestParam("tenantId")String tenantId);

    @PostMapping("user/selectDept")
    SysDept selectDept(@RequestParam("tenantId")String tenantId, @RequestParam("userId") Long userId);

    @PostMapping("user/deleteSysUser")
    void deleteSysUser(@RequestParam("userId")Long userId,@RequestParam("tenantId") String tenantId);

    @GetMapping("user/getAllRole")
    List<SysRole> selectSysRoleList(SysRoleVo sysRoleVo);

    @GetMapping("user/selectOneRole")
    SysRole selectOneRole(@RequestParam("roleId")Long roleId,@RequestParam("tenantId") String tenantId);

    @GetMapping("user/selectMenuList")
    List<MenuVo> selectMenuList(String tenantId);

    @GetMapping("user/selectMenuListByUserId")
    List<MenuVo> selectMenuListByUserId(@RequestParam("tenantId")String tenantId,@RequestParam("userId") String userId);

    @GetMapping("user/selectMenuListByRoleId")
    List<Long> selectMenuListByRoleId(@RequestParam("roleId") Long roleId,@RequestParam("b") Boolean b,@RequestParam("tenantId") String tenantId);

    @GetMapping("user/getAllUserRole")
    List<SysUserRole> getAllUserRole(SysUserRole sysUserRole);

    @GetMapping("user/deleteRoleMenuByIds")
    void deleteRoleMenu(@RequestParam("roleIds")Long[] roleIds,@RequestParam("tenantId") String tenantId);

    @GetMapping("user/deleteRoleDeptByIds")
    void deleteRoleDeptByIds(@RequestParam("roleIds")Long[] roleIds,@RequestParam("tenantId") String tenantId);

    @GetMapping("user/deleteRoleDeptById")
    void deleteRoleDeptById(@RequestParam("roleIds")Long roleId,@RequestParam("tenantId") String tenantId);

    @GetMapping("user/deleteRoleByIds")
    void deleteRoleByIds(@RequestParam("roleIds")Long[] roleIds,@RequestParam("tenantId") String tenantId);

    @PostMapping("user/updateRole")
    void updateRole(SysRole role);

    @PostMapping("user/insertRoleDeptList")
    Integer insertRoleDeptList(List<SysRoleDept> list);

    @PostMapping("user/selectAllocatedList")
    List<SysUser> selectAllocatedList(SysUserVo userVo);

    @PostMapping("user/unallocatedList")
    List<SysUser> unallocatedList(SysUserVo user);

    @PostMapping("user/saveSysUserRole")
    int saveSysUserRole(List<SysUserRole> list);

    @PostMapping("user/deleteAuthUser")
    int deleteAuthUser(SysUserRole userRole);

    @GetMapping("user/checkMenuNameUnique")
    SysMenu checkMenuNameUnique(@RequestParam("menuName")String menuName, @RequestParam("tenantId") Long tenantId, @RequestParam("parentId") Long parentId);

    @PostMapping("user/insertMenu")
    int insertMenu(SysMenu menu);

    @GetMapping("user/selectMenuById")
    SysMenu selectMenuById(@RequestParam("menuId")Long menuId,@RequestParam("tenantId") String tenantId);

    @PostMapping("user/updateMenu")
    SysMenu updateMenu(SysMenu menu);

    @GetMapping("user/hasChildByMenuId")
    int hasChildByMenuId(@RequestParam("menuId")Long menuId,@RequestParam("tenantId") String tenantId);

    @GetMapping("user/checkMenuExistRole")
    int checkMenuExistRole(@RequestParam("menuId")Long menuId,@RequestParam("tenantId") String tenantId);

    @GetMapping("user/deleteMenuById")
    Boolean deleteMenuById(@RequestParam("menuId")Long menuId,@RequestParam("tenantId") String tenantId);

    @GetMapping("user/getAllDept")
    List<SysDeptVo> getAllDepts(SysDeptVo dept);

    @GetMapping("user/getOneDept")
    SysDept selectDeptById(@RequestParam("deptId")Long deptId,@RequestParam("tenantId") Long tenantId);

    @PostMapping("user/insertDept")
    void insertDept(SysDeptVo dept);

    @GetMapping("user/selectNormalChildrenDeptById")
    int selectNormalChildrenDeptById(@RequestParam("deptId")Long deptId,@RequestParam("tenantId") Long tenantId);

    @PostMapping("user/updateDept")
    int updateDept(SysDeptVo dept);

    @GetMapping("user/hasChildByDeptId")
    int hasChildByDeptId(@RequestParam("deptId")Long deptId,@RequestParam("tenantId") String tenantId);

    @GetMapping("user/checkDeptExistUser")
    int checkDeptExistUser(@RequestParam("deptId")Long deptId,@RequestParam("tenantId")String tenantId);

    @GetMapping("user/deleteDeptById")
    void deleteDeptById(@RequestParam("deptId")Long deptId,@RequestParam("tenantId") String tenantId);

    @PostMapping("user/getAllPost")
    List<SysPost> getAllPost(SysPostVo post);

    @GetMapping("user/checkPostNameUnique")
    SysPost checkPostNameUnique(@RequestParam("postName")String postName,@RequestParam("tenantId") Long tenantId);

    @GetMapping("user/checkPostCodeUnique")
    SysPost checkPostCodeUnique(@RequestParam("postCode")String postCode,@RequestParam("tenantId") Long tenantId);

    @PostMapping("user/insertPost")
    void insertPost(SysPostVo post);

    @PostMapping("user/updatePost")
    void updatePost(SysPostVo post);

    @GetMapping("user/selectPostById")
    SysPost selectPostById(@RequestParam("postId")Long postId,@RequestParam("tenantId") String tenantId);

    @GetMapping("user/countUserPostById")
    int countUserPostById(@RequestParam("postId")Long postId,@RequestParam("tenantId")  String tenantId);

    @GetMapping("user/deletePostByIds")
    int deletePostByIds(@RequestParam("postIds")Long[] postIds,@RequestParam("tenantId") String tenantId);

    @GetMapping("user/getAllCity")
    List<SysAreaCities> findCityList(SysAreaCities sysAreaCities);

    @GetMapping("user/getAllDistricts")
    List<SysAreaDistricts> findDistrictsList(SysAreaDistricts sysAreaDistricts);

    @GetMapping("user/getAllProvinces")
    List<SysAreaProvinces> findProvincesList(SysAreaProvinces sysAreaProvinces);

}
